package com.chen.util;

public class ELFuncUtil {
	public static Double getGross(Double nh,Double oh,Double sh,Double hh,Double pf,Double bonus){
		Double result = (nh+oh+sh+hh)*pf+bonus;
		return result;
	}
	
	/*
	 * bf  250 个税起征点
	 * mf  起征率
	 * */
	public static Double getPaye(Double nh,Double oh,Double sh,Double hh,Double pf,Double bonus,Double nssa,Double nec,Double bf,Double mf){
		
		Double gross = getGross(nh,oh,sh,hh,pf,bonus);
		
		Double result = (gross-nssa-nec-bf)*mf;
		if (result < 0) {
			return 0.0;
		}
		return result;
	}
	/*
	 * af  AIDS基金系数  计算方式 个税*af
	 * */
	public static Double getTotal(Double nh,Double oh,Double sh,Double hh,Double pf,Double bonus,Double nssa,Double nec,Double af,Double bf,Double mf){
		
		Double paye = getPaye(nh,oh,sh,hh,pf,bonus,nssa,nec,bf,mf);
		
		Double result = nssa+paye+paye*af+nec;
		if (result < 0) {
			return 0.0;
		}
		return result;
	}
}
